'use strict';
const path = require('path');

const name = 'maobing后台管理系统';
const port = process.env.port || process.env.npm_config_port || 80;

module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? '/mb/' : '/',
  outputDir: 'mb',
  assetsDir: 'static',
  devServer: {
    hot: true,
    host: '0.0.0.0',
    port: port,
    proxy: {
      [process.env.VUE_APP_BASE_URL]: {
        target: 'http://localhost:3000',
        changeOrigin: true,
        pathRewrite: {
          ['^' + process.env.VUE_APP_BASE_URL]: '',
        },
      },
    },
    disableHostCheck: true,
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': path.join(__dirname, 'src'),
      },
    },
  },
  css: {
    extract: process.env.NODE_ENV === 'production',
    sourceMap: true
  },
  lintOnSave: false // 关闭eslint
};
